﻿<%@ Page Language="C#" MasterPageFile="~/ffl/ffl.master" AutoEventWireup="true" CodeFile="transfers.aspx.cs"
    Inherits="ffl_admin_transfers" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <form id="Form1" runat="server" method="post">
    <asp:CheckBox ID="ShowAll" runat="server" OnCheckedChanged="ShowAll_OnCheckedChange" Text="Show all transfers" AutoPostBack="true" Checked="true"/>
    <br />
    <asp:Label ID="ClubLabel" runat="server" Text="Filter by club" Enabled="false"></asp:Label>
    <asp:DropDownList runat="server" ID="ClubDropDown" AutoPostBack="true"
        DataValueField="Id" DataTextField="ClubName" OnSelectedIndexChanged="ClubDropDown_OnSelectedIndexChanged" Enabled="false">
    </asp:DropDownList>
    <br />
    <asp:Button ID="ImportFromEspn" runat="server" Text="Import transfers from Espn" 
        onclick="ImportFromEspn_Click" />
    <br />
    <asp:Repeater runat="server" ID="PlayerRepeater" OnItemDataBound="PlayerRepeater_ItemDataBound">
        <HeaderTemplate>
            <table width="100%" class="noborder">
                <thead>
                    <tr class="tableheader">
                        <td>
                            Pos.
                        </td>
                        <td>
                            Forename
                        </td>
                        <td>
                            Surname
                        </td>
                        <td>
                            Transfer from
                        </td>
                        <td>
                            Transfer to
                        </td>
                    </tr>
                </thead>
        </HeaderTemplate>
        <ItemTemplate>
            <tbody>
                <tr>
                    <td>
                        <asp:HiddenField runat="server" ID="TransferIdHidden" Value='<%# DataBinder.Eval(Container.DataItem, "Id") %>' />
                        <asp:HiddenField runat="server" ID="NewPlayerHidden" Value='<%# DataBinder.Eval(Container.DataItem, "NewPlayer") %>' />
                        <asp:HiddenField runat="server" ID="ClubIdHidden" Value='<%# DataBinder.Eval(Container.DataItem, "ClubId") %>' />
                        <asp:HiddenField runat="server" ID="EspnPlayerRefHidden" Value='<%# DataBinder.Eval(Container.DataItem, "EspnRef") %>' />
                        <asp:HiddenField runat="server" ID="PositionHidden" Value='<%# DataBinder.Eval(Container.DataItem, "PositionId") %>' />
                        <asp:HiddenField runat="server" ID="ExistingPlayerIdHidden" Value='<%# DataBinder.Eval(Container.DataItem, "PlayerId") %>' />
                        <asp:DropDownList runat="server" ID="PositionDropDown" DataValueField="Id" DataTextField="PositionShort">
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:TextBox ID="ForenameTextBox" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="SurnameTextBox" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="TransferFromLabel" runat="server"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="TransferToLabel" runat="server"></asp:Label>
                    </td>
                </tr>
            </tbody>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <asp:Button ID="ActionAllButton" runat="server" Text="Action all" 
        onclick="ActionAllButton_Click"/>
    </form>
</asp:Content>
